package com.yxw.live_vod_backend_boot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxw.live_vod_backend_boot.entity.YxProductSpecificationEntity;
import com.yxw.live_vod_backend_boot.vo.ProductSpecificationVO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 商品规格关联Mapper接口
 * @author xiexuxin
 * @date 2023-12-12
 */
@Repository
public interface ProductSpecificationMapper extends BaseMapper<YxProductSpecificationEntity> {

    /**
     * 批量插入商品与规格的关联信息
     * @param productSpecifications
     */
    void batchInsert(List<YxProductSpecificationEntity> productSpecifications);

    /**
     * 根据商品ID删除关联信息
     * @param productId
     */
    void deleteByProductId(Long productId);

    /**
     * 根据商品ID获取对应商品规格列表
     * @param productId
     * @return
     */
    List<ProductSpecificationVO> getProductSpecificationsByProductId(Long productId);
}
